#include <bits/stdc++.h>
#include <unordered_map>
using namespace std;

int main()
{
    string s;
    cin >> s;
    unordered_map<char, int> Map;
    
    Map.insert(pair<char, int>('G', 0));
    Map.insert(pair<char, int>('P', 0));
    Map.insert(pair<char, int>('L', 0));
    Map.insert(pair<char, int>('T', 0));
    // map计数
    for (unsigned int i = 0; i < s.length(); i++)
    {
        if (s[i] == 'G' || s[i] == 'P' || s[i] == 'L' || s[i] == 'T')
            Map[s[i]]++;
        if (s[i] == 'g' || s[i] == 'p' || s[i] == 'l' || s[i] == 't')
            Map[s[i] - 32]++;
    }
    
    while (Map.size()) {
        unordered_map<char, int>::iterator it;
        it = Map.find('G'); 
        if (it != Map.end()) {
            if (it->second == 0) Map.erase(it);
            else {
                cout << "G";
                it->second--;
            }
        }
        it = Map.find('P');
        if (it != Map.end()) {
            if (it->second == 0) Map.erase(it);
            else {
                cout << "P";
                it->second--;
            }
        }
        it = Map.find('L');
        if (it != Map.end()) {
            if (it->second == 0) Map.erase(it);
            else {
                cout << "L";
                it->second--;
            }
        }
        it = Map.find('T');
        if (it != Map.end()) {
            if (it->second == 0) Map.erase(it);
            else {
                cout << "T";
                it->second--;
            }
        }
    }
    cout << endl;
    return 0;
}